﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Following : MonoBehaviour {
    private Camera selfCamera;

    // Use this for initialization
    void Start()
    {
        if (Screen.width > 800 && false)
        {
            float w = (float)(Screen.width);
            selfCamera = GetComponent<Camera>();
            Rect rect = selfCamera.rect;
            rect.width = 800.0f / w;
            rect.x = (w - 800.0f) / w / 2;
            selfCamera.rect = rect;
        }
    }

    // Update is called once per frame
    void Update () {
        if (GameMgr.Instance().Bird() != null)
        {
            this.transform.position = new Vector3(GameMgr.Instance().Bird().transform.position.x, this.transform.position.y, this.transform.position.z);
        }
    }
}
